package com.ict.web.controller.yzq;

import java.math.BigDecimal;
import java.sql.ResultSet;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;

import com.ict.web.dto.ScoreAddDto;
import com.ict.web.dto.ScoreEditDto;
import com.ict.web.vo.PerIndicatorsVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.ict.common.annotation.Log;
import com.ict.common.core.controller.BaseController;
import com.ict.common.core.domain.AjaxResult;
import com.ict.common.enums.BusinessType;
import com.ict.web.domain.Score;
import com.ict.web.service.IScoreService;
import com.ict.common.utils.poi.ExcelUtil;
import com.ict.common.core.page.TableDataInfo;

/**
 * 得分Controller
 *
 * @author ruoyi
 * @date 2022-02-14
 */
@Api(tags = "绩效得分")
@RestController
@RequestMapping("/score")
public class ScoreController extends BaseController
{
    @Autowired
    private IScoreService scoreService;

    /**
     * 查询得分
     */
//    @PreAuthorize("@ss.hasPermi('web:score:list')")
    @ApiOperation("查询得分")
    @GetMapping("/list/{proId}")
    public Double list(@PathVariable Long proId)
    {
        return scoreService.selectScoreList(proId);
    }

    /**
     * 查询平均分
     * @return
     */
    @ApiOperation("查询平均分")
    @GetMapping("/averageScore")
    public BigDecimal averageScore(@RequestParam(value = "proIds",required = false) List<Long> proIds){
        return scoreService.selectAverageScore(proIds);
    }
}
